<template>
    <div class="shouye">
        <div class="box">
     <p>饿了么</p>
     <input type="text" placeholder="输入商家,商品名称">
    </div>
    <div class="banner">
        <img src="../assets/1.jpg" alt="">
    </div>
    <div class="boxone">
        <div class="like">
            <p>猜你喜欢</p>
        <div class="box1" >
            <span @click="dissclick(index)" v-for="(item,index) in tasklist" :key="index">{{item.text}}</span>
        </div>
        <div class="box2">
            <div class="one">年货节热卖</div>
            <div class="one">津贴联盟</div>
            <div class="one">满减优惠</div>
            <div class="one">品质联盟</div>
        </div>
        </div>
        <div class="box-item" >
            <div class="box-discounts" v-for="(item,index) in list" :key="index">
                <img :src="item.picUrl" alt="">
            <div class="item">
                <div class="name">{{item.name}}</div>
                <div class="distance">{{item.distance}}</div>
                <div class="minPriceTip">{{item.minPriceTip}}</div>
                <div class="monthSalesTip">{{item.monthSalesTip}}</div>
                <div class="shippingFeeTip">{{item.shippingFeeTip}}</div>
            </div>
         </div>
           
        </div>
      
    </div>
  
    </div>
 
</template>

<script >
import logo from "../assets/1.jpg";
import {shop_list} from "../api/api";
export default {
name:'shouye',
logo,
data(){
    return{
        currentIndex:0,
        tasklist:[
            {text:'综合排序▽'},
            {text:'距离最近'},
            {text:'销量最高'},
            {text:'筛选☟'},
        ],
        list:[]
    }
  },
  mounted(){
    shop_list({params:{}}).then((res)=>{
        this.list=res.data.list
    })
  },methods:{
       dissclick(index){
          this.currentIndex=index;
          if(this.currentIndex=1){
            
          }
           
       }
  }
}
</script>

<style scoped>
  .box p{
  font-size:30px ;
  margin-left: 15px;
  margin-bottom: 17px;
  padding-top: 10px;
}
.box{
  height: 120px;
  

  background-color: #1181ef;
}
.box input{
  width: 90%;
  height: 30px;
  text-align: center;
  margin-left: 15px;
  border-radius:30px ;
}
.banner img{
    width: 95%;
    height: 95%;
    margin: 9px;   
}
.like p{
    font-size: 20px;
    margin-bottom: 10px;
   
}
.boxone{
    margin-left: 15px;
    margin-right: 15px;
}
.box1{
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
}
.one{
    font-size: 12px;
    width: 72px;
    height: 29px;
    text-align: center;
    line-height: 29px;
    background-color: rgb(230, 222, 222);
    border-radius:5px ;
}
.box2{
    display: flex;
    justify-content: space-around;
}
.b1{
    font-size: 17px;
    font-weight: bold;
}
.box-item{
    width: 100%;
    height: 170px;
    overflow: auto;
    
}
.box-discounts{
    display: flex;
    margin-bottom: 20px;
    background-color: antiquewhite;
    padding: 10px;
}
.box-discounts img{
    width: 100px;
    height: 100px;
    margin-right: 5px;
}
</style>